/**
 * @file file.h
 */

#ifndef _FILE_H
#define _FILE_H

#include <stdio.h>
#include "node.h"

int file_is_available(Node *node, const char *file, unsigned int *size);
int file_get_chunk(Node *node, const char *file, int start, int end, char *data);
int file_set_chunk(Node *node, const char *file, int start, int end, const char *data);
/* NOTE: (I think) there is no need to create a file before writing to it, since
 * lseek() (and therefore fseek()) can go beyond the EOF and then write there */
/* NOTE to myself: nope, fseek() doesn't work like lseek() */

char *complete_path(Node *node, const char *file);

#endif /* _FILE_H */
